<template>
    <div id="main">
            <div class="tab" v-if="state">
                <div v-if="orderNum">
                     <el-button type='primary' @click="takeOrders">接单</el-button>
                </div>
                <div v-if="take == true && requestData.orderStatus == '待收货'">
                  <el-button type="primary" @click="confirmtake">确定收货</el-button>
                </div>
                <p class="title">订单详情</p>
                 <el-tabs tab-position="left" >
                    <el-tab-pane :label="basicInfo.label" class="tabItem">
                        <el-form class="form">
                                <div v-for="(item,key) in basicInfo.data" :key="key">
                                    <div v-if="detailData[key]&&item" class="item">
                                        <label class="labels">{{detailData[key]}}</label>
                                        <span class="value" v-if='key == "couponAmount"'>{{ item + num }}</span>
                                        <span class="value" v-else> {{item}}</span>
                                    </div>
                                </div>

                        </el-form>
                    </el-tab-pane>
                    <el-tab-pane :label="orderAttr.label" class="tabItem">
                            <el-form class="form" v-if="orderAttr.data.length>0">
                                <div v-for="(item,key) in orderAttr.data" :key="key">
                                    <div class="item">
                                        <label class="labels">{{item.attrName}}</label>
                                        <span class="value"> {{item.attrVal}}</span>
                                    </div>
                                </div>
                            </el-form>
                            <div v-if="orderAttr.data.length==0" style="margin-left:20px;font-size:22px;">
                                暂无数据
                            </div>

                    </el-tab-pane>
                    <el-tab-pane :label="testResult.label">
                        <tableVue :list="testList" :state="false" :pagination="true">

                        </tableVue>
                    </el-tab-pane>
                    <el-tab-pane :label="evaluateImg.label" class="tabItem">
                         <el-form class="form" v-if="JSON.stringify(evaluateImg.data)!='{}'">
                                <div v-for="(item,key) in evaluateImg.data" :key="key">
                                    <div class="item">
                                        <!-- evaluateImg.data[key][0].cpeoName -->
                                        <label class="labels">{{item[0].cpesName}}</label>
                                        <div class="value">
                                            <div v-for="(val,idx) in item" :key="idx" class="imgbox">
                                               <a :href="val.pictureUrl" target="_blank" >
                                                    <img :src="val.pictureUrl" alt="" style="width:150px;height:150px" title="点击查看大图">
                                               </a>
                                                <span>{{val.cpeoName}}</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </el-form>
                            <div v-if="(JSON.stringify(evaluateImg.data)=='{}')" style="margin-left:20px;font-size:22px;">
                                暂无数据
                            </div>
                    </el-tab-pane>
                    <el-tab-pane :label="QaDetails.label" class="tabItem">
                         <tableVue :list="QaList" :state="false" :pagination="true">
                        </tableVue>
                    </el-tab-pane>
                    <el-tab-pane :label="logisticsInfo.label" class="tabItem">
                        <tableVue :list="logisticsList" :state="false" :pagination="true">
                            <slot>
                                <el-table-column label="操作" align="center">
                                    <template slot-scope="scope">
                                        <el-button
                                        size="mini"
                                        type="primary"
                                        @click="handleEdits(scope.row)">查看物流信息
                                        </el-button>

                                    </template>
                                </el-table-column>
                            </slot>
                        </tableVue>

                    </el-tab-pane>
                </el-tabs>
            </div>
            <h2 class="noData">
               {{message}}
            </h2>
            <el-dialog
                title="提示"
                :visible="dialogVisible"
                width="40%"
                >
                <div class="noData" v-if="nodata">
                    暂无物流信息
                </div>
               <div >
                            <el-steps direction="vertical"  :active="wlData.data.length" space="60px">
                                <el-step v-for="(item,key) in wlData.data" :title="item.status" :key="key" :description="item.context"></el-step>
                                <!-- <el-step title="步骤 2"></el-step>
                                <el-step title="步骤 3" description="这是一段很长很长很长的描述性文字"></el-step>
                                <el-step title="步骤 3" description="这是一段很长很长很长的描述性文字"></el-step> -->
                            </el-steps>
                        </div>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="dialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
                </span>
            </el-dialog>



    </div>
</template>
<script>

import dialogVue from '@/components/dialog.vue'
import tableVue from '@/components/alltable.vue'
import {
    getexpressDetails,
    getexpressDetailNo,
    takeOrder,
    LogisticsCargoInfo,
    wlInfo
} from '@/api/appraiserAdmin/appraiserAdmin'
import {
  confirmdelivery
} from '@/api/warehouse/index'

export default {
    components:{
        dialogVue,tableVue
    },
    props:['orderNum','orderId',"deliveryadmin",'id','logisticsType','take'],
    data(){
        return{
            detailData:{
                orderNo:'订单号',
                orderId:'订单ID',
                productId:'寄卖商品ID',
                productName:'寄卖商品名称',
                contactName:'联系人姓名',
                contactTel:'联系号码',
                consignTerm:'寄卖期限',
                consignType:'寄卖方式',
                consignPrice:'实际寄售价格',
                orderCreateTime:'下单时间',
                bespeakOptionEnd:'预约时间结束',
                bespeakOptionStart:'预约时间开始',
                bespeakTime:'预约时间/日期',
                cancelTime:'订单取消时间',
                cancelType:'订单取消方式',
                // channel:'订单来源主渠道',
                // childChannel:'订单来源子渠道',
                visitAddress:'上门预约详细地址',
                fullName : '上门地址',
                // visitProvinceId:'上门预约省',
                // visitCityId:'上门预约市',
                // visitAreaId:'上门预约县区',
                couponId:'使用优惠券ID',
                userId:'寄卖用户ID',
                storeId:'预约门店ID',
                userCancelCode:'订单取消原因',
                userCancelRemark:'订单取消原因详情',
                evaluationAmount:'估价金额加价前',
                couponAmount:'估价金额加价后',
                evaluationRemark:'估计备注',
                evaluationStatus:'估价状态',
                evaluationType:'估价方式：',
                examineTime:'审核时间',
                isGenuine:'是否为真品',
                isIncrease:'是否加价',
                increasePrice:'加价金额',
                increaseRemark:'加价情况说明',
                // logicalDeletion:'逻辑删除状态',
                remark:'备注',
                isRedeem:'是否可赎回',
                orderStatus:'订单状态',
                paymentStatus:'出款状态',
                redeemStatus:'赎回状态',
            },
            basicInfo:{
                 label:"基本信息",
                 data:{}
            },//基本信息
            orderAttr:{
                label:"寄卖订单属性",
                 data:[]
            },//寄卖订单信息
            testResult:{
                label:"本机检测结果",
                 data:{}
            },//本机检测结果
            evaluateImg:{
                label:"估价图片",
                data:{}
            },//估价图片
            QaDetails:{
                label:"问答详情",
                data:[]
            },//问答详情
            logisticsInfo:{
                label:"物流信息",
                 data:[]
            },//物流信息.
            requestData:{

            },
            testList:{ //本机检测结果
                 thead : [ // table头部
                    {label:'手机功能',prop:"question",rowspan:1},
                    {label:'是否支持',prop:"answer",rowspan:1},
                ],
                tbody : [] //table body
            },
            num : 0,
            QaList:{ //问答
                 thead : [ // table头部
                    {label:'提问',prop:"question",rowspan:1},
                    {label:'回答',prop:"answer",rowspan:1},
                ],
                tbody : [] //table body
            },
            logisticsList:{ //问答
                 thead : [ // table头部
                    {label:'收货人地址',prop:"fullName",rowspan:1},
                    {label:'收货人',prop:"deliverName",rowspan:1},
                    {label:'收货人电话',prop:"receiverTel",rowspan:1},
                    {label:'详细地址',prop:"deliverAddress",rowspan:1},
                    {label:'物流编号',prop:"logisticsNo",rowspan:1},
                ],
                tbody : [] //table body
            },
            state:false,
            message:'',
            orderIds:'',
            dialogVisible:false,
            wlData:{
                data:[]
            },
            nodata:false


        }
    },
    mounted(){
      // this.order(this.deliveryadmin)
    },
    watch: {
        orderNum(val) {
            if(val){
              this.getListData(val)
            }
        },
        orderId(val){
          if (val) {
            this.getListData(val)
          }
        },
    },
    methods:{
        confirmtake () {//仓库中心确定收货
          confirmdelivery(this.id,this.logisticsType).then(res=>{
            if (res.data.code == 'OK') {
              this.$message.success('收货成功!')
              this.getListData(this.id)
            } else {
              this.$message.error(res.data.message)
            }
          })
        },
        getListData(data){//列表数据
            this.evaluateImg.data ={};
            if(this.orderNum){
                    getexpressDetailNo(data).then(res=>{
                            if(res.data.code=="OK"){
                                this.state =true;
                                this.requestData = res.data.data;
                                this.orderIds = res.data.data.orderId;
                                this.message=""
                                this.QaDetails.data = res.data.data.detectionDetails.conditionOptions;//问答
                                this.QaList.tbody =res.data.data.detectionDetails.conditionOptions;
                                if(res.data.data.pictures.length>0){

                                    res.data.data.pictures.map(res=>{
                                        if(!this.evaluateImg.data[res.cpesId]){
                                            this.evaluateImg.data[res.cpesId] = [];
                                            this.evaluateImg.data[res.cpesId].push(res)
                                        }else{
                                            this.evaluateImg.data[res.cpesId].push(res)
                                        }
                                    })
                                }

                                this.orderAttr.data = res.data.data.attributes; //寄卖订单信息
                                this.orderAttr.data.map(item=>{
                                    if(item.attrVal=="Y"){
                                        item.attrVal ="是"
                                    }else if(item.attrVal=="N"){
                                        item.attrVal ="否"
                                    }
                                })
                                this.logisticsList.tbody = res.data.data.logistics;//物流信息
                                this.testResult.data = res.data.data.detectionDetails.intelligentDetectionSelfs; //本机检测结果
                                this.testList.tbody =  res.data.data.detectionDetails.intelligentDetectionSelfs.map(res=>{
                                if(res.answer =="N"){
                                    res.answer = "否"
                                }
                                if(res.answer =="Y"){
                                    res.answer = "是"
                                }
                                    return  res;
                                })

                                this.basicInfo.data = res.data.data;//基本信息,

                                delete this.basicInfo.data.detectionDetails;
                                delete this.basicInfo.data.logistics
                                delete this.basicInfo.data.attributes
                                delete this.basicInfo.data.pictures
                                // switch(this.requestData.consignType){
                                //     case "MEN_DIAN":
                                //         this.requestData.consignType = "去门店";
                                //         break
                                //     case "SHANG_MEN":
                                //         this.requestData.consignType = "上门";
                                //         break
                                //     case "KUAIDI":
                                //         this.requestData.consignType = "快递";
                                //         break
                                //     case "PREV_MEN_DIAN":
                                //         this.requestData.consignType = "门店预约";
                                //         break
                                //     case "PREV_PIC":
                                //         this.requestData.consignType = "图片估价";
                                //         break
                                //     default:
                                //         break;
                                // }
                                switch(this.requestData.consignTerm){
                                    case 1:
                                        this.requestData.consignTerm = "1个月";
                                        break
                                    case 3:
                                        this.requestData.consignTerm = "3个月";
                                        break
                                    case 6:
                                        this.requestData.consignTerm = "6个月";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.evaluationStatus){
                                    case 1001:
                                        this.requestData.evaluationStatus = "待估价";
                                        break
                                    case 1002:
                                        this.requestData.evaluationStatus = "已估价";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.evaluationType){
                                    case 1:
                                        this.requestData.evaluationType = "系统自动估价";
                                        break
                                    case 2:
                                        this.requestData.evaluationType = "评估师估价";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.isGenuine){
                                    case "Y":
                                        this.requestData.isGenuine = "是";
                                        break
                                    case "N":
                                        this.requestData.isGenuine = "否";
                                        break
                                    default:
                                        break;
                                }
                            if (this.requestData.consignType == 'MEN_DIAN') {
                                this.requestData.consignType = "去门店";
                            switch (this.requestData.orderStatus) {
                                case 0 : this.requestData.orderStatus = '等待用户到店'
                                break;
                                case 1 : this.requestData.orderStatus = '用户到店'
                                break
                                case 4 : this.requestData.orderStatus = '订单完成（待打款）'
                                break
                                case 5 : this.requestData.orderStatus = '打款完成（可赎回）'
                                break
                                case 9 : this.requestData.orderStatus = '已取消'
                                break
                                case 10 : this.requestData.orderStatus = '待出库'
                                break
                                case 11 : this.requestData.orderStatus = '已出库'
                                break
                                case 12 : this.requestData.orderStatus = '待收货'
                                break
                                case 13 : this.requestData.orderStatus = '已赎回'
                                break
                                case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                                default:
                            }
                        } else if (this.requestData.consignType == 'SHANG_MEN') {
                            this.requestData.consignType = "上门";
                            switch (this.requestData.orderStatus) {
                                case 0 : this.requestData.orderStatus = '等待评估师上门'
                                break;
                                case 1 : this.requestData.orderStatus = '评估师已上门'
                                break
                                case 4 : this.requestData.orderStatus = '订单完成（待打款）'
                                break
                                case 5 : this.requestData.orderStatus = '打款完成（可赎回）'
                                break
                                case 9 : this.requestData.orderStatus = '已取消'
                                break
                                case 10 : this.requestData.orderStatus = '待出库'
                                break
                                case 11 : this.requestData.orderStatus = '已出库'
                                break
                                case 12 : this.requestData.orderStatus = '待收货'
                                break
                                case 13 : this.requestData.orderStatus = '已赎回'
                                break
                                case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                                default:
                            }
                        } else if (this.requestData.consignType == 'KUAIDI') {
                            this.requestData.consignType = "快递";
                            switch (this.requestData.orderStatus) {
                            case 0 : this.requestData.orderStatus = '待收货'
                                break;
                            case 1 : this.requestData.orderStatus = '已收货'
                                break
                            case 2 : this.requestData.orderStatus = '待估价'
                                break
                            case 3 : this.requestData.orderStatus = '已估价（用户可取消）'
                                break
                            case 4 : this.requestData.orderStatus = '订单完成（待打款）'
                                break
                            case 5 : this.requestData.orderStatus = '打款完成（可赎回）'
                                break
                            case 6 : this.requestData.orderStatus = '用户不同意'
                                break
                            case 7 : this.requestData.orderStatus = '待收货（用户不同意时）'
                                break
                            case 8 : this.requestData.orderStatus = '已完成（用户不同意时）'
                                break
                            case 10 : this.requestData.orderStatus = '待出库'
                                break
                            case 11 : this.requestData.orderStatus = '已出库'
                                break
                            case 12 : this.requestData.orderStatus = '待收货'
                                break
                            case 13 : this.requestData.orderStatus = '已赎回'
                                break
                            case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                            default:
                            }
                        } else if(this.requestData.consignType=="PREV_PIC"){
                            this.requestData.consignType = "图片估价";
                            switch(this.requestData.orderStatus){
                                case 0 : this.requestData.orderStatus = '待估价'
                                    break
                                case 1 : this.requestData.orderStatus = '已估价'
                                    break
                                default:
                                    break;
                            }
                        }else{
                            switch (this.requestData.orderStatus) {
                            case 0 : this.requestData.orderStatus = '待估价'
                                break;
                            case 1 : this.requestData.orderStatus = '已估价'
                                break
                            case 10 : this.requestData.orderStatus = '待出库'
                                break
                            case 11 : this.requestData.orderStatus = '已出库'
                                break
                            case 12 : this.requestData.orderStatus = '待收货'
                                break
                            case 13 : this.requestData.orderStatus = '已赎回'
                                break
                            case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                            default:
                                break;

                            }
                        }
                                switch(this.requestData.paymentStatus){
                                    case "CREATED":
                                        this.requestData.paymentStatus = "初始状态";
                                        break
                                    case "PAYMENT":
                                        this.requestData.paymentStatus = "付款中";
                                        break
                                    case "PAY_SUCCESS":
                                        this.requestData.paymentStatus = "已付款";
                                        break
                                    case "PAY_FAILED":
                                        this.requestData.paymentStatus = "付款失败";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.isRedeem){
                                    case "Y":
                                        this.requestData.isRedeem = "是";
                                        break
                                    case "N":
                                        this.requestData.isRedeem = "否";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.redeemStatus){
                                    case "CREATED":
                                        this.requestData.redeemStatus = "初始状态";
                                        break
                                    case "WAIT":
                                        this.requestData.redeemStatus = "待赎回";
                                        break
                                    case "OVERDUE":
                                        this.requestData.redeemStatus = "过期未赎回";
                                        break
                                    case "SUCCESS":
                                        this.requestData.redeemStatus = "已赎回";
                                        break
                                    case "FAILED":
                                        this.requestData.redeemStatus = "赎回失败";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.isIncrease){
                                    case "Y":
                                        this.requestData.isIncrease = "是";
                                        break
                                    case "N":
                                        this.requestData.isIncrease = "否";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.cancelType){
                                    case "C1":
                                        this.requestData.cancelType = "用户取消";
                                        break
                                    case "C2":
                                        this.requestData.cancelType = "评估师取消";
                                        break
                                    case "C3":
                                        this.requestData.cancelType = "系统自动取消";
                                        break
                                    case "C4":
                                        this.requestData.cancelType = "其他";
                                        break
                                    default:
                                        break;
                                }
                                this.requestData.orderCreateTime=this.switchTime(this.requestData.orderCreateTime);
                                this.requestData.bespeakOptionEnd=this.switchTime(this.requestData.bespeakOptionEnd)
                                this.requestData.bespeakOptionStart=this.switchTime(this.requestData.bespeakOptionStart)
                                this.requestData.cancelTime=this.switchTime(this.requestData.cancelTime)
                                this.requestData.examineTime=this.switchTime(this.requestData.examineTime)
                                this.requestData.orderCreateTime=this.switchTime(this.requestData.orderCreateTime)
                                this.$emit('orderStatus',this.requestData.orderStatus)
                            }else{
                                this.state =false;
                                this.message = "暂无数据";
                            }
                        })
            }else{
                getexpressDetails(data).then(res=>{
                  if(res.data.code=="OK"){
                                this.state =true;
                                this.requestData = res.data.data;
                                this.orderIds = res.data.data.orderId;
                                this.message=""
                                this.QaDetails.data = res.data.data.detectionDetails.conditionOptions;//问答
                                this.QaList.tbody =res.data.data.detectionDetails.conditionOptions;
                                if(res.data.data.pictures.length>0){

                                    res.data.data.pictures.map(res=>{
                                        if(!this.evaluateImg.data[res.cpesId]){
                                            this.evaluateImg.data[res.cpesId] = [];
                                            this.evaluateImg.data[res.cpesId].push(res)
                                        }else{
                                            this.evaluateImg.data[res.cpesId].push(res)
                                        }
                                    })
                                }

                                this.orderAttr.data = res.data.data.attributes; //寄卖订单信息
                                this.orderAttr.data.map(item=>{
                                    if(item.attrVal=="Y"){
                                        item.attrVal ="是"
                                    }else if(item.attrVal=="N"){
                                        item.attrVal ="否"
                                    }
                                })
                                this.logisticsList.tbody = res.data.data.logistics;//物流信息
                                this.testResult.data = res.data.data.detectionDetails.intelligentDetectionSelfs; //本机检测结果
                                this.testList.tbody =  res.data.data.detectionDetails.intelligentDetectionSelfs.map(res=>{
                                if(res.answer =="N"){
                                    res.answer = "否"
                                }
                                if(res.answer =="Y"){
                                    res.answer = "是"
                                }
                                    return  res;
                                })

                                this.basicInfo.data = res.data.data;//基本信息,
                                // this.basicInfo.data =   this.basicInfo.data.concat(res.data.data.logistics);//物流信息,
                                this.num = res.data.data.evaluationAmount
                                delete this.basicInfo.data.detectionDetails;
                                // delete this.basicInfo.data.logistics
                                delete this.basicInfo.data.attributes
                                delete this.basicInfo.data.pictures
                                // switch(this.requestData.consignType){
                                //     case "MEN_DIAN":
                                //         this.requestData.consignType = "去门店";
                                //         break
                                //     case "SHANG_MEN":
                                //         this.requestData.consignType = "上门";
                                //         break
                                //     case "KUAIDI":
                                //         this.requestData.consignType = "快递";
                                //         break
                                //     case "PREV_MEN_DIAN":
                                //         this.requestData.consignType = "门店预约";
                                //         break
                                //     case "PREV_PIC":
                                //         this.requestData.consignType = "图片估价";
                                //         break
                                //     default:
                                //         break;
                                // }
                                switch(this.requestData.consignTerm){
                                    case 1:
                                        this.requestData.consignTerm = "1个月";
                                        break
                                    case 3:
                                        this.requestData.consignTerm = "3个月";
                                        break
                                    case 6:
                                        this.requestData.consignTerm = "6个月";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.evaluationStatus){
                                    case 1001:
                                        this.requestData.evaluationStatus = "待估价";
                                        break
                                    case 1002:
                                        this.requestData.evaluationStatus = "已估价";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.evaluationType){
                                    case 1:
                                        this.requestData.evaluationType = "系统自动估价";
                                        break
                                    case 2:
                                        this.requestData.evaluationType = "评估师估价";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.isGenuine){
                                    case "Y":
                                        this.requestData.isGenuine = "是";
                                        break
                                    case "N":
                                        this.requestData.isGenuine = "否";
                                        break
                                    default:
                                        break;
                                }
                            if (this.requestData.consignType == 'MEN_DIAN') {
                                this.requestData.consignType = "去门店";
                            switch (this.requestData.orderStatus) {
                                case 0 : this.requestData.orderStatus = '等待用户到店'
                                break;
                                case 1 : this.requestData.orderStatus = '用户到店'
                                break
                                case 4 : this.requestData.orderStatus = '订单完成（待打款）'
                                break
                                case 5 : this.requestData.orderStatus = '打款完成（可赎回）'
                                break
                                case 9 : this.requestData.orderStatus = '已取消'
                                break
                                case 10 : this.requestData.orderStatus = '待出库'
                                break
                                case 11 : this.requestData.orderStatus = '已出库'
                                break
                                case 12 : this.requestData.orderStatus = '待收货'
                                break
                                case 13 : this.requestData.orderStatus = '已赎回'
                                break
                                case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                                default:
                            }
                        } else if (this.requestData.consignType == 'SHANG_MEN') {
                            this.requestData.consignType = "上门";
                            switch (this.requestData.orderStatus) {
                                case 0 : this.requestData.orderStatus = '等待评估师上门'
                                break;
                                case 1 : this.requestData.orderStatus = '评估师已上门'
                                break
                                case 4 : this.requestData.orderStatus = '订单完成（待打款）'
                                break
                                case 5 : this.requestData.orderStatus = '打款完成（可赎回）'
                                break
                                case 9 : this.requestData.orderStatus = '已取消'
                                break
                                case 10 : this.requestData.orderStatus = '待出库'
                                break
                                case 11 : this.requestData.orderStatus = '已出库'
                                break
                                case 12 : this.requestData.orderStatus = '待收货'
                                break
                                case 13 : this.requestData.orderStatus = '已赎回'
                                break
                                case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                                default:
                            }
                        } else if (this.requestData.consignType == 'KUAIDI') {
                            this.requestData.consignType = "快递";
                            switch (this.requestData.orderStatus) {
                            case 0 : this.requestData.orderStatus = '待收货'
                                break;
                            case 1 : this.requestData.orderStatus = '已收货'
                                break
                            case 2 : this.requestData.orderStatus = '待估价'
                                break
                            case 3 : this.requestData.orderStatus = '已估价（用户可取消）'
                                break
                            case 4 : this.requestData.orderStatus = '订单完成（待打款）'
                                break
                            case 5 : this.requestData.orderStatus = '打款完成（可赎回）'
                                break
                            case 6 : this.requestData.orderStatus = '用户不同意'
                                break
                            case 7 : this.requestData.orderStatus = '待收货（用户不同意时）'
                                break
                            case 8 : this.requestData.orderStatus = '已完成（用户不同意时）'
                                break
                            case 10 : this.requestData.orderStatus = '待出库'
                                break
                            case 11 : this.requestData.orderStatus = '已出库'
                                break
                            case 12 : this.requestData.orderStatus = '待收货'
                                break
                            case 13 : this.requestData.orderStatus = '已赎回'
                                break
                            case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                            default:
                            }
                        } else if(this.requestData.consignType=="PREV_PIC"){
                            this.requestData.consignType = "图片估价";
                            switch(this.requestData.orderStatus){
                                case 0 : this.requestData.orderStatus = '待估价'
                                    break
                                case 1 : this.requestData.orderStatus = '已估价'
                                    break
                                default:
                                    break;
                            }
                        }else{
                            switch (this.requestData.orderStatus) {
                            case 0 : this.requestData.orderStatus = '待估价'
                                break;
                            case 1 : this.requestData.orderStatus = '已估价'
                                break
                            case 10 : this.requestData.orderStatus = '待出库'
                                break
                            case 11 : this.requestData.orderStatus = '已出库'
                                break
                            case 12 : this.requestData.orderStatus = '待收货'
                                break
                            case 13 : this.requestData.orderStatus = '已赎回'
                                break
                            case 14 : this.requestData.orderStatus = '到期不可赎回'
                                break
                            default:
                                break;

                            }
                        }
                                switch(this.requestData.paymentStatus){
                                    case "CREATED":
                                        this.requestData.paymentStatus = "初始状态";
                                        break
                                    case "PAYMENT":
                                        this.requestData.paymentStatus = "付款中";
                                        break
                                    case "PAY_SUCCESS":
                                        this.requestData.paymentStatus = "已付款";
                                        break
                                    case "PAY_FAILED":
                                        this.requestData.paymentStatus = "付款失败";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.isRedeem){
                                    case "Y":
                                        this.requestData.isRedeem = "是";
                                        break
                                    case "N":
                                        this.requestData.isRedeem = "否";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.redeemStatus){
                                    case "CREATED":
                                        this.requestData.redeemStatus = "初始状态";
                                        break
                                    case "WAIT":
                                        this.requestData.redeemStatus = "待赎回";
                                        break
                                    case "OVERDUE":
                                        this.requestData.redeemStatus = "过期未赎回";
                                        break
                                    case "SUCCESS":
                                        this.requestData.redeemStatus = "已赎回";
                                        break
                                    case "FAILED":
                                        this.requestData.redeemStatus = "赎回失败";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.isIncrease){
                                    case "Y":
                                        this.requestData.isIncrease = "是";
                                        break
                                    case "N":
                                        this.requestData.isIncrease = "否";
                                        break
                                    default:
                                        break;
                                }
                                switch(this.requestData.cancelType){
                                    case "C1":
                                        this.requestData.cancelType = "用户取消";
                                        break
                                    case "C2":
                                        this.requestData.cancelType = "评估师取消";
                                        break
                                    case "C3":
                                        this.requestData.cancelType = "系统自动取消";
                                        break
                                    case "C4":
                                        this.requestData.cancelType = "其他";
                                        break
                                    default:
                                        break;
                                }
                                this.requestData.orderCreateTime=this.switchTime(this.requestData.orderCreateTime);
                                this.requestData.bespeakOptionEnd=this.switchTime(this.requestData.bespeakOptionEnd)
                                this.requestData.bespeakOptionStart=this.switchTime(this.requestData.bespeakOptionStart)
                                this.requestData.cancelTime=this.switchTime(this.requestData.cancelTime)
                                this.requestData.examineTime=this.switchTime(this.requestData.examineTime)
                                this.requestData.orderCreateTime=this.switchTime(this.requestData.orderCreateTime)
                                this.$emit('orderStatus',this.requestData.orderStatus)
                            }else{
                                this.state =false;
                                this.message = "暂无数据";
                            }
                        })
            }


        },
        handleEdits(data){

            let obj={
                no:data.logisticsNo,
                company:data.logisticsCompanyCode
            }
            wlInfo(obj).then(res=>{
                if(res.data.code=="OK"){
                    if(res.data.data.data.length>0){
                        this.wlData.data = res.data.data.data.reverse()
                        this.dialogVisible =true;
                        this.nodata = false;
                    }else{

                        this.dialogVisible =true;
                        this.nodata =true;
                    }


                }else{
                    this.$message.error(res.data.message)
                }
            })
        },
        takeOrders(){
            let obj={
                consignOrderId:this.orderIds
            };
            takeOrder(obj,"POST").then(res=>{
                if(res.data.code=="OK"){
                    this.$message.success('接单成功！');
                    this.$router.push({name:'expressageWorkOrder'})
                }else{
                    this.$message.error(res.data.message)
                }
            })
        }

    }
}
</script>
<style scoped>
    #main{
        width:100%;
        margin:0 auto;
        color: #333
    }
    .form{

        border:1px solid #ccc;
    }
    .item{
        width: 100%;
        border-bottom: 1px solid #ccc;
        min-height: 60px;;
        line-height: 60px;
        display: flex;
        box-sizing: border-box;

    }
    .title{

        text-align: center;
        font-size: 26px;
    }
    .labels{
        width:200px;
        text-align: center;
        border-right: 1px solid #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .value{
        flex: 1;
        margin-left: 100px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;

    }
    .noData{
        width: 800px;
        text-align: center;
    }
    .imgbox{
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-right: 10px;
    }

</style>
